<include file="Common/header" />
<div class="container">
    <div class="row">
        <div class="col-md-2">
            <include file="Common/left_siber" />
        </div>
        <div class="col-md-10">
            <div class="page-header"><h3>{$page_title}</h3></div>
            <div class="btn-group  role="group" aria-label="" style="margin-bottom:10px;" >
            <a  class="btn btn-default <if condition="CONTROLLER_NAME eq 'Category' && ACTION_NAME eq 'index'">active</if>" href="{:U('Category/index')}">分类</a>&nbsp;
            <a  class="btn btn-default <if condition="CONTROLLER_NAME eq 'Category' && ACTION_NAME eq 'add'">active</if>" href="{:U('Category/add')}" style="margin-bottom:10px;">添加分类 </a>
        </div>
        <form action="{:U('Category/saveHandler')}" method="post">
            <input type="hidden" name="id" value="{$categorys['id']}" />
            <div class="form-group">
                <label class="label  label-success"> 类名称</label>
                <input type="text" class="form-control"  placeholder="类名称 " name="cname"  value="{$categorys['cname']}">
            </div>
            <div class="form-group">
                <input type="text" class="form-control"  placeholder="排序" name="sort" value="{$categorys['sort']}">
            </div>
            <div class="form-group">
                <select class="form-control" name="pid">
                    <option value="0"> 父级类</option>
                      <foreach name="category" item="c">

                        <option value="{$c['id']}" <if condition="$c['id'] eq $categorys['pid']">selected</if> >
                            <if condition="$c['pid'] neq 0 " ><?php echo str_repeat('&nbsp;',$c['level']*8); ?></if>|{$c['cname']}</option>

                      </foreach>

                </select>
            </div>
            <div class="radio">
                <label class="radio-inline">
                    <input type="radio" name="status" id="inlineRadio1" value="1" <if condition="$categorys['status']==1" >checked</if>>开启
                </label>
                <label class="radio-inline">
                    <input type="radio" name="status" id="inlineRadio2" value="0" <if condition="$categorys['status']==0" >checked</if>>关闭
                </label>
            </div>
            <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span>保存</button>
        </form>
    </div>
</div>
</div>
</div>
<include file="Common/footer" />